package com.API.dal.entities;

// Generated 03.06.2013 4:15:36 by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Objects generated by hbm2java
 */
@Entity
@Table(name = "OBJECTS", schema = "PUBLIC", catalog = "PUBLIC", uniqueConstraints = @UniqueConstraint(columnNames = "NAME"))
public class Objects implements java.io.Serializable {

	private Integer id;
	private ObjectsTypes objectsTypes;
	private Location location;
	private String name;
	private String fullName;
	private String address;
	private String description;
	private Set<ProjectContractor> projectContractorsForContractorId = new HashSet<ProjectContractor>(
			0);
	private Set<ContractorCost> contractorCosts = new HashSet<ContractorCost>(0);
	private Set<ProjectsCosts> projectsCostses = new HashSet<ProjectsCosts>(0);
	private Set<WorksObjects> worksObjectses = new HashSet<WorksObjects>(0);
	private Set<IncomesCustomersProjects> incomesCustomersProjectsesForProjectId = new HashSet<IncomesCustomersProjects>(
			0);
	private Set<IncomesCustomersProjects> incomesCustomersProjectsesForCustomerId = new HashSet<IncomesCustomersProjects>(
			0);
	private Set<ProjectContractor> projectContractorsForProjectId = new HashSet<ProjectContractor>(
			0);
	private Set<EquipmentsProjects> equipmentsProjectses = new HashSet<EquipmentsProjects>(
			0);
	private Set<ProjectCustomer> projectCustomersForCustomerId = new HashSet<ProjectCustomer>(
			0);
	private Set<Orders> ordersesForProjectId = new HashSet<Orders>(0);
	private Set<EmployeeProject> employeeProjects = new HashSet<EmployeeProject>(
			0);
	private Set<Orders> ordersesForProviderId = new HashSet<Orders>(0);
	private Set<ProjectCustomer> projectCustomersForProjectId = new HashSet<ProjectCustomer>(
			0);

	public Objects() {
	}

	public Objects(ObjectsTypes objectsTypes, Location location, String name,
			String fullName, String address) {
		this.objectsTypes = objectsTypes;
		this.location = location;
		this.name = name;
		this.fullName = fullName;
		this.address = address;
	}

	public Objects(
			ObjectsTypes objectsTypes,
			Location location,
			String name,
			String fullName,
			String address,
			String description,
			Set<ProjectContractor> projectContractorsForContractorId,
			Set<ContractorCost> contractorCosts,
			Set<ProjectsCosts> projectsCostses,
			Set<WorksObjects> worksObjectses,
			Set<IncomesCustomersProjects> incomesCustomersProjectsesForProjectId,
			Set<IncomesCustomersProjects> incomesCustomersProjectsesForCustomerId,
			Set<ProjectContractor> projectContractorsForProjectId,
			Set<EquipmentsProjects> equipmentsProjectses,
			Set<ProjectCustomer> projectCustomersForCustomerId,
			Set<Orders> ordersesForProjectId,
			Set<EmployeeProject> employeeProjects,
			Set<Orders> ordersesForProviderId,
			Set<ProjectCustomer> projectCustomersForProjectId) {
		this.objectsTypes = objectsTypes;
		this.location = location;
		this.name = name;
		this.fullName = fullName;
		this.address = address;
		this.description = description;
		this.projectContractorsForContractorId = projectContractorsForContractorId;
		this.contractorCosts = contractorCosts;
		this.projectsCostses = projectsCostses;
		this.worksObjectses = worksObjectses;
		this.incomesCustomersProjectsesForProjectId = incomesCustomersProjectsesForProjectId;
		this.incomesCustomersProjectsesForCustomerId = incomesCustomersProjectsesForCustomerId;
		this.projectContractorsForProjectId = projectContractorsForProjectId;
		this.equipmentsProjectses = equipmentsProjectses;
		this.projectCustomersForCustomerId = projectCustomersForCustomerId;
		this.ordersesForProjectId = ordersesForProjectId;
		this.employeeProjects = employeeProjects;
		this.ordersesForProviderId = ordersesForProviderId;
		this.projectCustomersForProjectId = projectCustomersForProjectId;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TYPE_ID", nullable = false)
	public ObjectsTypes getObjectsTypes() {
		return this.objectsTypes;
	}

	public void setObjectsTypes(ObjectsTypes objectsTypes) {
		this.objectsTypes = objectsTypes;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "LOCATION_ID", nullable = false)
	public Location getLocation() {
		return this.location;
	}

	public void setLocation(Location location) {
		this.location = location;
	}

	@Column(name = "NAME", unique = true, nullable = false, length = 64)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "FULL_NAME", nullable = false, length = 256)
	public String getFullName() {
		return this.fullName;
	}

	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	@Column(name = "ADDRESS", nullable = false, length = 256)
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Column(name = "DESCRIPTION", length = 512)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "objectsByContractorId")
	public Set<ProjectContractor> getProjectContractorsForContractorId() {
		return this.projectContractorsForContractorId;
	}

	public void setProjectContractorsForContractorId(
			Set<ProjectContractor> projectContractorsForContractorId) {
		this.projectContractorsForContractorId = projectContractorsForContractorId;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "objects")
	public Set<ContractorCost> getContractorCosts() {
		return this.contractorCosts;
	}

	public void setContractorCosts(Set<ContractorCost> contractorCosts) {
		this.contractorCosts = contractorCosts;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "objects")
	public Set<ProjectsCosts> getProjectsCostses() {
		return this.projectsCostses;
	}

	public void setProjectsCostses(Set<ProjectsCosts> projectsCostses) {
		this.projectsCostses = projectsCostses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "objects")
	public Set<WorksObjects> getWorksObjectses() {
		return this.worksObjectses;
	}

	public void setWorksObjectses(Set<WorksObjects> worksObjectses) {
		this.worksObjectses = worksObjectses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "objectsByProjectId")
	public Set<IncomesCustomersProjects> getIncomesCustomersProjectsesForProjectId() {
		return this.incomesCustomersProjectsesForProjectId;
	}

	public void setIncomesCustomersProjectsesForProjectId(
			Set<IncomesCustomersProjects> incomesCustomersProjectsesForProjectId) {
		this.incomesCustomersProjectsesForProjectId = incomesCustomersProjectsesForProjectId;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "objectsByCustomerId")
	public Set<IncomesCustomersProjects> getIncomesCustomersProjectsesForCustomerId() {
		return this.incomesCustomersProjectsesForCustomerId;
	}

	public void setIncomesCustomersProjectsesForCustomerId(
			Set<IncomesCustomersProjects> incomesCustomersProjectsesForCustomerId) {
		this.incomesCustomersProjectsesForCustomerId = incomesCustomersProjectsesForCustomerId;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "objectsByProjectId")
	public Set<ProjectContractor> getProjectContractorsForProjectId() {
		return this.projectContractorsForProjectId;
	}

	public void setProjectContractorsForProjectId(
			Set<ProjectContractor> projectContractorsForProjectId) {
		this.projectContractorsForProjectId = projectContractorsForProjectId;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "objects")
	public Set<EquipmentsProjects> getEquipmentsProjectses() {
		return this.equipmentsProjectses;
	}

	public void setEquipmentsProjectses(
			Set<EquipmentsProjects> equipmentsProjectses) {
		this.equipmentsProjectses = equipmentsProjectses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "objectsByCustomerId")
	public Set<ProjectCustomer> getProjectCustomersForCustomerId() {
		return this.projectCustomersForCustomerId;
	}

	public void setProjectCustomersForCustomerId(
			Set<ProjectCustomer> projectCustomersForCustomerId) {
		this.projectCustomersForCustomerId = projectCustomersForCustomerId;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "objectsByProjectId")
	public Set<Orders> getOrdersesForProjectId() {
		return this.ordersesForProjectId;
	}

	public void setOrdersesForProjectId(Set<Orders> ordersesForProjectId) {
		this.ordersesForProjectId = ordersesForProjectId;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "objects")
	public Set<EmployeeProject> getEmployeeProjects() {
		return this.employeeProjects;
	}

	public void setEmployeeProjects(Set<EmployeeProject> employeeProjects) {
		this.employeeProjects = employeeProjects;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "objectsByProviderId")
	public Set<Orders> getOrdersesForProviderId() {
		return this.ordersesForProviderId;
	}

	public void setOrdersesForProviderId(Set<Orders> ordersesForProviderId) {
		this.ordersesForProviderId = ordersesForProviderId;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "objectsByProjectId")
	public Set<ProjectCustomer> getProjectCustomersForProjectId() {
		return this.projectCustomersForProjectId;
	}

	public void setProjectCustomersForProjectId(
			Set<ProjectCustomer> projectCustomersForProjectId) {
		this.projectCustomersForProjectId = projectCustomersForProjectId;
	}

}
